#!/bin/sh

case $# in

0)	rm -f ./ixp_members.txt
	rm -f ../C++/data/ixp_members.txt
	find *.py -exec python '{}' \;
	mv ./ixp_members.txt ../C++/data/ixp_members.txt ;;
1)	if test "x$1" = "x-v"
	then
		# -v: verbose output
		rm -f ./ixp_members.txt
		rm -f ../C++/data/ixp_members.txt
		find *.py -print -exec python '{}' \;
		mv ./ixp_members.txt ../C++/data/ixp_members.txt
	else
		echo "parser.sh: unknown argument \"$1\""
		echo 'usage: sh parser.sh [-v]'
	fi ;;

*)	echo 'parser.sh: wrong number of arguments'
	echo 'usage: sh parser.sh [-v]' ;;

esac
